﻿using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace Cngot.Extensions.Trace.Http
{
    internal class LogEventPropertyFactory : ILogEventPropertyFactory
    {
        public IDictionary<string, object?>? TagObjects => Activity.Current?.TagObjects?.ToDictionary(w => w.Key, w => w.Value);

        public void SetTag(string key, object? value)
        {
            Activity.Current?.SetTag(key, value);
        }
    }
}
